

def bucket_sort(a, buckets_num):
    len_a = len(a)
    if len_a <= 1:
        return
    max_value = max(a)
    min_value = min(a)
    bucket_volume = (max_value - min_value) // buckets_num + 1
    buckets = [[] for i in range(buckets_num)]
    for x in a:
        index = (x - min_value) // bucket_volume
        buckets[index].append(x)
    ans = []
    for bucket in buckets:
        bucket.sort()
        ans += bucket
    return ans


n = int(input())
a = list(map(int, input().split()))
a = bucket_sort(a, min(1000, len(a)//2 + 1))
print(*a)



